
/*
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  These are the four essential freedoms with GNU GPL software:
 *  1: freedom to run the program, for any purpose
 *  2: freedom to study how the program works, and change it to make it do what you wish
 *  3: freedom to redistribute copies to help your Free Software friends
 *  4: freedom to distribute copies of your modified versions to your Free Software friends
 *   ,           ,
 *  /             \
 * ((__-^^-,-^^-__))
 * `-_---'  `---_-'
 *  `--|o`   'o|--'
 *      \  `  /
 *       ): :(
 *       :o_o:
 *        "-"
 *
 * SPDX-License-Identifier: GPL-3.0+
 * License-Filename: LICENSE
 */

%{

#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "main.h"
#include "ast.h"
#include "list.h"

/* at parse error called by bison code */
static void yyerror (char *s)
{
	printf("%s\n",s);
	return;
}

%}

%verbose

%union {
	char *string; /* from lexer */
	int intnum; /* from lexer */
};

%token T_ELSE "else"
%token T_GOTO "goto"
%token T_IF "if"
%token T_INT "int"
%token T_RETURN "return"
%token T_VOID "void"
%token T_ADD "+"
%token T_SUB "-"
%token T_MUL "*"
%token T_DIV "/"
%token T_LT "<"
%token T_LTE "<="
%token T_GT ">"
%token T_GTE ">="
%token T_EQ "=="
%token T_NEQ "!="
%token T_NOT "!"
%token T_ASSIGN "="
%token T_SEMI ";"
%token T_COMMA ","
%token T_ROPEN "("
%token T_RCLOSE ")"
%token T_SOPEN "["
%token T_SCLOSE "]"
%token T_COPEN "{"
%token T_CCLOSE "}"
%token T_ID "identifier"
%token T_NUM "number"

%%

program:
	;

%%

/* end. */
